package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.H5SpreadMapper;
import com.jieshuibao.model.db.H5Spread;
import com.jieshuibao.model.db.H5SpreadExample;

@Service
public class H5SpreadService{
	
	@Resource
	private H5SpreadMapper h5SpreadMapper;
	
	public void addH5Spread(H5Spread h5Spread) {
		h5SpreadMapper.insertSelective(h5Spread);
	}
	
	public void delH5SpreadByPhone(String phone) {
		h5SpreadMapper.deleteByPrimaryKey(phone);
	}
	
	public void updateH5Spread(H5Spread h5Spread) {
		h5SpreadMapper.updateByPrimaryKeySelective(h5Spread);
	}
	
	public void updateH5SpreadByExample(H5Spread h5Spread,H5SpreadExample h5SpreadExample){
	    h5SpreadMapper.updateByExampleSelective(h5Spread,h5SpreadExample);
	}
	
	public H5Spread getH5SpreadByPhone(String phone) {
		return h5SpreadMapper.selectByPrimaryKey(phone);
	}
	
	public List<H5Spread> getPageH5Spread(H5SpreadExample h5SpreadExample) {
		return h5SpreadMapper.selectPage(h5SpreadExample);
	}
	
	public int countH5Spread(H5SpreadExample h5SpreadExample) {
		return h5SpreadMapper.countByExample(h5SpreadExample);
	}
	
	public List<H5Spread> selectByExample(H5SpreadExample example){
	    return h5SpreadMapper.selectByExample(example);
	}
}
